// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0


SubComponent := Rectangle {
    property <[int]> m;
    HorizontalLayout {
        for foo in m: Rectangle {
            if foo < 100 : TouchArea {
                clicked => { foo += 8; }
            }
        }
    }
}

TestCase := Rectangle {
    width: 100px;
    height: 100px;
    property <[int]> mod;
    SubComponent {
        m: mod;
    }
}

/*
```rust
use slint::Model;
let instance = TestCase::new().unwrap();

let the_model = std::rc::Rc::new(slint::VecModel::<i32>::from(vec![1, 2, 3]));
instance.set_mod(the_model.clone().into());
slint_testing::send_mouse_click(&instance, 50., 50.);
assert_eq!(the_model.row_data(1).unwrap() , 2+8);
```

```cpp
auto handle = TestCase::create();
const TestCase &instance = *handle;
std::vector<int> array { 1 , 2 ,  3 };
auto the_model = std::make_shared<slint::VectorModel<int>>(std::move(array));
instance.set_mod(the_model);

slint_testing::send_mouse_click(&instance, 50., 50.);
assert_eq(*the_model->row_data(1) , 2+8);
```


```js
var instance = new slint.TestCase({});
instance.mod = [1, 2, 3];
slintlib.private_api.send_mouse_click(instance, 50., 50.);
assert.equal(instance.mod.rowData(1), 2+8);
```


*/
